package com.jim.director.test;

import com.jim.director.framework.annotation.*;

import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;

@Actor(order = 0)
public class Kid {
    private int x;

    private int y;

    @ActorAutowired
    private Set<Frog> frog;

    @SystemFrame
    private int currentFrame;

    @Init
    public void init() {
        System.out.println("kid init");
        System.out.println("kid init:"+frog.toString());
        System.out.println("kid init:"+frog.toString());
    }

    @Action
    public void walk(){
        int[] numbers = {-1, 0, 1};
        Random random = new Random();
        int randomNumber = numbers[random.nextInt(numbers.length)];// choose one of numbers
        x += randomNumber;
        randomNumber = numbers[random.nextInt(numbers.length)];
        y += randomNumber;
        System.out.println(currentFrame + ":kid walk to " + x + "," + y);
    }
}
